﻿using Ecommerce.Areas.Manager.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ecommerce.Common;

namespace Ecommerce.Areas.Home.Controllers
{
    public class ContactController : Controller
    {
        //
        // GET: /Home/Contact/

        private DatabaseContext db = new DatabaseContext();

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Create(Contact c)
        {
            if (ModelState.IsValid)
            {
                c.Status = (int)EcommerceEnum.ContactStatus.UnRead;
                db.Contacts.Add(c);
                return View();
            }

            return View("Index", c);
        }
    }
}
